import type { FormSchema } from '@/components/core/schema-form/';

export const userSchemas: FormSchema<API.CreateOrganParams>[] = [
  {
    field: 'name',
    component: 'Input',
    label: '机构名称',
    rules: [{ required: true }],
    componentProps: {
      maxlength: 32,
      showCount: true,
    },
  },
  {
    field: 'typeId',
    component: 'Select',
    label: '机构类型',
    rules: [{ required: true }],
  },
  {
    field: 'type',
    component: 'Input',
    label: '机构类型名称',
    vShow: false,
  },
  {
    field: 'shortName',
    component: 'Input',
    label: '机构简称',
    rules: [{ required: true }],
    componentProps: {
      maxlength: 16,
      showCount: true,
    },
  },
  {
    field: 'address',
    component: 'Cascader',
    label: '机构地址',
    rules: [{ required: true, type: 'array' }],
  },
  {
    field: 'remark',
    component: 'Input',
    label: '备注',
    componentProps: {
      maxlength: 32,
      showCount: true,
    },
  },
  {
    field: 'cityCode',
    label: '城市编号',
    vShow: false,
  },
  {
    field: 'city',
    label: '城市',
    vShow: false,
  },
  {
    field: 'countyCode',
    label: '区县编号',
    vShow: false,
  },
  {
    field: 'county',
    label: '区县',
    vShow: false,
  },
  {
    field: 'townCode',
    label: '乡镇编号',
    vShow: false,
  },
  {
    field: 'town',
    label: '乡镇',
    vShow: false,
  },
];
